package com.pn.taikao.mapper;

import com.pn.taikao.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {
    int insert(User user);

    int update(User user);

    int deleteById(@Param("id") Long id);

    User selectById(@Param("id") Long id);

    User selectByUsername(@Param("username") String username);

    User selectByEmail(@Param("email") String email);

    List<User> selectPage(@Param("username") String username,
                          @Param("roleType") String roleType,
                          @Param("offset") int offset,
                          @Param("limit") int limit);

    long count(@Param("username") String username,
               @Param("roleType") String roleType);
}





